/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.webapi.sub.AddAccessID;
/*     */ import com.newcrm.webapi.sub.ReportAccessID;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class CompanyAccess extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = -5368595862407142766L;
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  34 */     if (!checkLogin(request)) {
/*  35 */       super.showLoginPage(request, response);
/*  36 */       return;
/*     */     }
/*     */ 
/*  39 */     User user = super.getLoginUser(request);
/*  40 */     if (!user.isAdmin) {
/*  41 */       response.sendRedirect(request.getContextPath() + "/signin");
/*  42 */       return;
/*     */     }
/*     */ 
/*  45 */     String url = request.getRequestURI();
/*  46 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*  47 */     if ((param != null) && (param.length == 1) && 
/*  48 */       ("open".equals(param[0]))) {
/*  49 */       AbstractAction action = new ReportAccessID(this);
/*     */       try {
/*  51 */         action.parse(request, response);
/*     */       } catch (NotFoundException e) {
/*  53 */         request.getRequestDispatcher("/errorpage.jsp").forward(
/*  54 */           request, response);
/*     */       }
/*  56 */       return;
/*     */     }
/*     */ 
/*  60 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/*  65 */     return new AddAccessID(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/*  70 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/*  75 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/*  80 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/*  85 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/*  90 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/*  95 */     return null;
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 100 */     return "/accessID";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 105 */     return null;
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.CompanyAccess
 * JD-Core Version:    0.6.1
 */